package com.qipay.thirdpart.vo;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.qipay.utils.ParamUtils;

/**
 * Creator: Yao
 * Date:    2017/10/11
 * For:
 * Other:
 */
public class TFB8Response {

    @SerializedName("serialno_desc")
    private String serialnoDesc;
    @SerializedName("serialno_state")
    private int serialnoState;
    @SerializedName("sp_serialno")
    private String spSerialno;
    @SerializedName("spid")
    private String spid;
    @SerializedName("tfb_rsptime")
    private String tfbRsptime;
    @SerializedName("tfb_serialno")
    private String tfbSerialno;
    @SerializedName("sign")
    private String sign;

    public String getSerialnoDesc() {
        return serialnoDesc;
    }

    public void setSerialnoDesc(String serialnoDesc) {
        this.serialnoDesc = serialnoDesc;
    }

    public int getSerialnoState() {
        return serialnoState;
    }

    public void setSerialnoState(int serialnoState) {
        this.serialnoState = serialnoState;
    }

    public String getSpSerialno() {
        return spSerialno;
    }

    public void setSpSerialno(String spSerialno) {
        this.spSerialno = spSerialno;
    }

    public String getSpid() {
        return spid;
    }

    public void setSpid(String spid) {
        this.spid = spid;
    }

    public String getTfbRsptime() {
        return tfbRsptime;
    }

    public void setTfbRsptime(String tfbRsptime) {
        this.tfbRsptime = tfbRsptime;
    }

    public String getTfbSerialno() {
        return tfbSerialno;
    }

    public void setTfbSerialno(String tfbSerialno) {
        this.tfbSerialno = tfbSerialno;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public static void main(String[] args) {
        // init
        Gson gson = new Gson();
        TFB8Response res;
        String info = "responseData=serialno_desc=户名错误&serialno_state=3&sp_serialno=2017101009021171915651546276268&spid=1800046681&tfb_rsptime=20171010090215&tfb_serialno=2017101000030382&sign=920e4bdcbf9fbfcf4967f0caaedc9d97";
        info = "responseData=serialno_desc=交易成功&serialno_state=1&sp_serialno=2017101009023465639407555650482&spid=1800046681&tfb_rsptime=20171010090237&tfb_serialno=2017101000030384&sign=5dda83fb446f4cdbf59d3e9a0f3e9bb1";

        // convert
        info = ParamUtils.toJson(info);
        System.out.println(info);

        // pass
        res = gson.fromJson(info, TFB8Response.class);
        System.out.println(res.getSerialnoDesc());
        System.out.println(res.getSerialnoState());
    }
}
